#include <iostream>
using namespace std;

const int kMaxN = 2e5 + 10;
const int kInf = 1e9;

int prefix[kMaxN], suffix[kMaxN], a[kMaxN];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  for (cin >> T; T; T--) {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }

    int p = kInf;
    for (int i = 0; i < n; i++) {
      prefix[i] = p;
      p = min(p, a[i]);
    }

    int s = -kInf;
    for (int i = n - 1; i >= 0; i--) {
      suffix[i] = s;
      s = max(s, a[i]);
    }

    for (int i = 0; i < n; i++) {
      if (prefix[i] < a[i] && a[i] < suffix[i]) {
        cout << "0";
      } else {
        cout << "1";
      }
    }
    cout << "\n";
  }
  return 0;
}